package miroshnichenko.gallery.domain;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

public class User {

    @Length(max = 30, message = "Username must be in range 30")
    private String firstName;

    @Length(max = 30, message = "Username must be in range 30")
    private String lastName;

    @NotBlank(message = "Email can not be blank")
    @Email(message = "Invalid email")
    private String email;

    @NotBlank(message = "Password must not be blank")
    @Length(min = 6, max = 30, message = "Password must be between 6 and 30")
    private String password;

    @NotBlank(message = "Confirm password must not be blank")
    @Length(min = 6, max = 30, message = "Confirm password must be between 6 and 30")
    private String confirmPassword;

    private boolean adminRights;

    public String getConfirmPassword() {
        return confirmPassword;
    }

    public void setConfirmPassword(String confirmPassword) {
        this.confirmPassword = confirmPassword;
    }

    public boolean isAdmin() {
        return adminRights;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean getAdminRights() {
        return adminRights;
    }

    public void setAdminRights(boolean adminRights) {
        this.adminRights = adminRights;
    }
}
